//
//  MineVC.swift
//  ProjectApp
//
//  Created by jack on 2021/1/5.
//

import UIKit

class MineVC: BaseVC {
    @IBOutlet weak var loginBtn: UIButton!
    
    @IBOutlet weak var settingBtn: UIButton!
    @IBAction func loginBtnClick(_ sender: Any) {
        let vc = LoginVC()
        vc.hidesBottomBarWhenPushed = true
        self.navigationController?.pushViewController(vc, animated: true)
    }
    @IBAction func settingBtnClick(_ sender: Any) {
        let vc = SettingVC()
        vc.hidesBottomBarWhenPushed = true
        self.navigationController?.pushViewController(vc, animated: true)
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        let _ = NotificationCenter.default.rx.notification(CPLANGUAGE_CHANGE_NOTIFICATION).subscribe { (not) in
             self.refreshUI()
         }
        refreshUI()
    }


    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.navigationController?.setNavigationBarHidden(true, animated: animated)
    }
    
    override func viewWillDisappear(_ animated: Bool) {
         self.navigationController?.setNavigationBarHidden(false, animated: animated)
        super.viewWillDisappear(animated)
    }
    
    
    func refreshUI() {
        self.settingBtn.setTitle("mine_setting".localizedString(table: nil), for: UIControl.State.normal)
    }

}
